package com.jk.bgmainconsumer.service;

import com.jk.bgmainconsumer.entity.OrderLogEntity;
import com.jk.bgmainconsumer.entity.UserInfoEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("BGLOGPROVIDER")
@Component
public interface UserConsummerService {

    @RequestMapping("test/findTest")
    public String test(@RequestParam String name);

    /**
     * @description:  新增用户表所用
     * @param: [userInfoEntity]
     * @return: void
     * @author Liu
     * @date: 2021/9/1 14:09
     */
    @PostMapping("test/addUserInfo")
    void addUserInfo(@RequestBody UserInfoEntity userInfoEntity);

    /**
     * @description:  查询用户信息表
     * @param: [userInfoEntity]
     * @return: java.util.List<com.jk.bgmainconsumer.entity.UserInfoEntity>
     * @author Liu
     * @date: 2021/9/1 14:10
     */
    @RequestMapping("test/queryUserInfo")
    List<UserInfoEntity> queryUserInfo(@SpringQueryMap UserInfoEntity userInfoEntity);

    /**
     * @description:  新增订单表
     * @param: [orderLogEntity]
     * @return: void
     * @author Liu
     * @date: 2021/9/1 14:10
     */
    @RequestMapping("order/addOrder")
    void addOrder(@RequestBody OrderLogEntity orderLogEntity);

    /**
     * @description:  查询订单表信息
     * @param: [orderLogEntity]
     * @return: java.util.List<com.jk.bgmainconsumer.entity.OrderLogEntity>
     * @author Liu
     * @date: 2021/9/1 14:10
     */
    @RequestMapping("order/queryOrderList")
    List<OrderLogEntity> queryOrderList(@SpringQueryMap OrderLogEntity orderLogEntity);


    @RequestMapping("test/queryOrderById")
    OrderLogEntity queryOrderById(@RequestParam Integer id);
}
